﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AlgoTest
{
    public class StackQueue<T>
    {
        private Stack<T> _stack1 = new Stack<T>();
        private Stack<T> _stack2 = new Stack<T>();

        public void Push(T val)
        {
            this._stack1.Push(val);
        }

        public T Pop()
        {
            if(this._stack2.Count > 0)
                return this._stack2.Pop();

            while (this._stack1.Count > 0)
                this._stack2.Push(this._stack1.Pop());

            return this._stack2.Pop();
        }
    }
}
